\subsection{Curl in tensor form}
The curl of a vector function can be expressed in tensor form as
$$\mathop{\rm curl}{\bf F}=\epsilon_{ijk}\,{\partial F_k\over\partial x_j}$$
where $\epsilon_{ijk}$ is the Levi-Civita tensor.
The following script demonstrates that this formula is equivalent
to computing curl the old fashioned way.

\medskip
\verb$-- Define epsilon.$

\verb$epsilon=zero(3,3,3)$

\verb$epsilon[1,2,3]=1$

\verb$epsilon[2,3,1]=1$

\verb$epsilon[3,1,2]=1$

\verb$epsilon[3,2,1]=-1$

\verb$epsilon[1,3,2]=-1$

\verb$epsilon[2,1,3]=-1$

\verb$-- F is a generic vector function.$

\verb$F=(FX(),FY(),FZ())$

\verb$-- A is the curl of F.$

\verb$A=outer(epsilon,d(F,(x,y,z)))$

\verb$A=contract(A,3,4) --sum across k$

\verb$A=contract(A,2,3) --sum across j$

\verb$-- B is the curl of F computed the old fashioned way.$

\verb$BX=d(F[3],y)-d(F[2],z)$

\verb$BY=d(F[1],z)-d(F[3],x)$

\verb$BZ=d(F[2],x)-d(F[1],y)$

\verb$B=(BX,BY,BZ)$

\verb$-- Are A and B equal? Subtract to find out.$

\verb$A-B$

$$\left(\matrix{0\cr0\cr0}\right)$$

\newpage

\noindent
The following is a variation on the previous script.
The product $\epsilon_{ijk}\,\partial F_k/\partial x_j$
is computed in just one line of code.
In addition, the outer product and the contraction across $k$
are now computed with a dot product.

\medskip
\verb$F=(FX(),FY(),FZ())$

\verb$epsilon=zero(3,3,3)$

\verb$epsilon[1,2,3]=1$

\verb$epsilon[2,3,1]=1$

\verb$epsilon[3,1,2]=1$

\verb$epsilon[3,2,1]=-1$

\verb$epsilon[1,3,2]=-1$

\verb$epsilon[2,1,3]=-1$

\verb$A=contract(dot(epsilon,d(F,(x,y,z))),2,3)$

\verb$BX=d(F[3],y)-d(F[2],z)$

\verb$BY=d(F[1],z)-d(F[3],x)$

\verb$BZ=d(F[2],x)-d(F[1],y)$

\verb$B=(BX,BY,BZ)$

\verb$-- Are A and B equal? Subtract to find out.$

\verb$A-B$

$$\left(\matrix{0\cr0\cr0}\right)$$

